package com.jzo2o.customer.controller.operation;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.request.CertificationAuditReqDTO;
import com.jzo2o.customer.model.dto.response.AgencyCertificationAuditResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * \* User: chy
 * \* Date: 2025/9/26  18:38
 * \* Description:
 * \
 */
@RestController("operationAgencyCertificationAuditController")
@RequestMapping("/operation/agency-certification-audit")
@Api(tags = "机构端 - 服务人员进行认证信息相关接口")
@Slf4j
public class AgencyCertificationAuditController {

    @Resource
    private IAgencyCertificationAuditService agencyCertificationAuditService;
    /**
     * 运营端认证机构信息分页查询
     *
     * @param queryReqDTO
     * @return
     */
    @GetMapping("/page")
    public PageResult<AgencyCertificationAuditResDTO> page(AgencyCertificationAuditPageQueryReqDTO queryReqDTO) {
        log.info("分页查询机构认证信息:{}", queryReqDTO);
        PageResult<AgencyCertificationAuditResDTO> pageResult =  agencyCertificationAuditService.queryAgencyCertificationAuditPage(queryReqDTO);
        return pageResult;
    }
    /**
     * 审核服务人员认证信息
     *
     * @param id
     */
    @PutMapping("/audit/{id}")
    public void audit(@PathVariable ("id") Long id, CertificationAuditReqDTO auditReqDTO) {
        log.info("审核机构认证信息:{}", auditReqDTO);
        agencyCertificationAuditService.audit(id, auditReqDTO);
    }
}
